<script setup lang="ts">
import {onMounted} from 'vue'
import TheWelcome from '../components/TheWelcome.vue'

onMounted(() => {
  console.log('onMounted start')
  getStockSymbol()
  console.log('onMounted end')
})

function sleep(ms: number) {
  var start = Date.now(),
    end = start + ms
  console.log('start:', start, 'end', end)
  console.log('Date.now():', Date.now() < end)

  while (Date.now() < end);
  return
}
async function getStockSymbol() {
  console.log('getStockSymbol called')
  // await setTimeout(() => {
  //   console.log(Date.now())
  // }, 2000)

  await sleep(2000)
  console.log('getStockSymbol end')
}
</script>

<template>
  <main>
    <TheWelcome />
  </main>
</template>
